Warn when a parent is destroyed
authorMatthias Clasen <mclasen@redhat.com>
Sun, 30 Aug 2009 15:14:40 +0000 (11:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 30 Aug 2009 15:14:40 +0000 (11:14 -0400)
Previously gdk_window_new would silently return NULL. Bug 590921.

gdk/gdkwindow.c

index ec9aa56233849dd1fa42d6fc7670d37461e1a109..3acf0ff4af84366be2513ef7c8bc9a841e136dfb 100644 (file)
@@ -913,23 +913,26 @@ recompute_visible_regions_internal (GdkWindowObject *private,
 
       if (gdk_region_empty (private->clip_region))
        visibility = GDK_VISIBILITY_FULLY_OBSCURED;
-      else {
-       if (private->shape)
-         fully_visible = gdk_region_equal (private->clip_region,
-                                           private->shape);
-       else
-         {
-           r.x = 0;
-           r.y = 0;
-           r.width = private->width;
-           r.height = private->height;
-           fully_visible = gdk_region_rect_equal (private->clip_region, &r);
-         }
-
-       if (fully_visible)
-         visibility = GDK_VISIBILITY_UNOBSCURED;
-       else
-         visibility = GDK_VISIBILITY_PARTIAL;
+      else
+        {
+          if (private->shape)
+            {
+             fully_visible = gdk_region_equal (private->clip_region,
+                                               private->shape);
+            }
+          else
+            {
+             r.x = 0;
+             r.y = 0;
+             r.width = private->width;
+             r.height = private->height;
+             fully_visible = gdk_region_rect_equal (private->clip_region, &r);
+           }
+
+         if (fully_visible)
+           visibility = GDK_VISIBILITY_UNOBSCURED;
+         else
+           visibility = GDK_VISIBILITY_PARTIAL;
        }
 
       if (private->visibility != visibility)
@@ -1194,7 +1197,10 @@ gdk_window_new (GdkWindow     *parent,
   g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL);
 
   if (GDK_WINDOW_DESTROYED (parent))
-    return NULL;
+    {
+      g_warning ("gdk_window_new(): parent is destroyed\n");
+      return NULL;
+    }
 
   if (attributes->window_type == GDK_WINDOW_OFFSCREEN &&
       _gdk_native_windows)